using RichFrame;
using RichFrame.UIFrame;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public abstract class UIFormBase
{
    public virtual bool IsActive 
    { 
        get;
        protected set;
    }
    public string assetPath;
    public string formName;
    public abstract ShowType showType
    {
        get;
    }
    protected GameObject formView;
    protected bool inited = false;
    public virtual void Init() 
    {
        RegisterUIEvent();
        inited = true;
    }
    public virtual void Update(float deltaTime)
    {

    }
    public abstract void RegisterUIEvent();
    public abstract void Show();
    public abstract void Hide();
    protected virtual void CreateForm()
    {
        formView = GameObject.Instantiate(AssetsManager.Instance.LoadAsset<GameObject>(assetPath), UIFormManager.Instance.UIRoot);
    }

    public enum ShowType
    {
        Normal,
        /// <summary>
        /// 显示在层级最顶层
        /// </summary>
        Popup,
        /// <summary>
        /// 隐藏其它
        /// </summary>
        HideOther
    }
}
